#!/bin/bash

# run a single junit test case
# optionally run the java vm in a debugger.  for example:
# DEBUG_PROG=gdb ./junit.sh

. `dirname $0`/java-env.sh

JUNIT_RUNNER=org.junit.runner.JUnitCore

JUNIT_TEST=${JUNIT_TEST:="com.googlecode.svnj.DAVServerTest"}

# pickup the javahl classes
JAVAHL_JAR=$SVN_HOME/lib/svn-javahl/svn-javahl.jar

if [ ! -z "$DEBUG_PROG" ] ; then
 # this assumes gdb, but what the hey
 DEBUG_PROG="$DEBUG_PROG --args"
fi

$DEBUG_PROG java -Dtest.dir=$BASEDIR/test-out $VMARGS \
 -cp $CLASSPATH:$BASEDIR/test-classes:$JAVAHL_JAR \
 $JUNIT_RUNNER $JUNIT_TEST

exit $?
